package com.fangyi.yunmusic.controller.es;


import com.fangyi.yunmusic.pojo.es.SongDocument;
import com.fangyi.yunmusic.service.es.SongSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SongSearchController {

    @Autowired
    private SongSearchService songSearchService;

    @GetMapping("/song/search")
    public Object querySong(Integer pageNum, Integer pageSize, String query) {
//        Page<SongDocument> page = songSearchService.querySong(pageNum, pageSize, query);
//        return page;
        return songSearchService.querySongVO(pageNum, pageSize, query);
    }


}
